package com.easywan.util;

public class VifUtils {
	private static String code = "qwertyuiopasdfghjkzxcl123456";
	/**
	 * 获取验证码
	 * @param count 验证码长度
	 * @return
	 */
	public static String getVifCode(int count){
		StringBuffer sb = new StringBuffer();
		for(int i = 0; i < count; i++){
			int index = ((int)(Math.random() * 100)) % code.length();
			sb.append(code.charAt(index));
		}
		return sb.toString();
	}
	/**
	 * 获取验证码 默认为6个长度
	 * @return
	 */
	public static String getVifCode(){
		return getVifCode(6);
	}
}
